package com.china08.yxyapi.repository.mg.huodong;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import com.china08.yxyapi.entity.mg.huodong.healthcompetition.YxyCompetitionSchool;

public interface YxyCompetitionSchoolRepository extends MongoRepository<YxyCompetitionSchool, String> {

	/**
	 * 根据学校id查询
	 * 
	 * @param id
	 * @return
	 */
	YxyCompetitionSchool findTop1BySchoolId(String id);

	/**
	 * 分页查询根据areaCodeCity
	 * 
	 * @param areaCodeCity
	 * @param pageable
	 * @return
	 */
	Page<YxyCompetitionSchool> findBySchoolIdNotInAndAreaCodeCity(List<String> ids, String areaCodeCity,
			Pageable pageable);

	/**
	 * 分页查询根据areaCodeDistrict
	 * 
	 * @param areaCodeDistrict
	 * @param pageable
	 * @return
	 */
	Page<YxyCompetitionSchool> findBySchoolIdNotInAndAreaCodeDistrict(List<String> ids, String areaCodeDistrict,
			Pageable pageable);

	/**
	 * 分页查询根据areaCodeDistrict schoolname
	 * 
	 * @param schoolId
	 * @param status
	 * @param pageable
	 * @return
	 */
	Page<YxyCompetitionSchool> findBySchoolIdNotInAndAreaCodeDistrictAndSchoolNameLike(List<String> ids,
			String areaCodeDistrict, String name, Pageable pageable);

	/**
	 * 分页查询根据schoolId,status,grade
	 * 
	 * @param schoolId
	 * @param status
	 * @param pageable
	 * @return
	 */
	Page<YxyCompetitionSchool> findBySchoolIdNotInAndAreaCodeCityAndSchoolNameLike(List<String> ids,
			String areaCodeCity, String name, Pageable pageable);

}
